﻿using System;

namespace ConsoleApp1
{
    internal class prime
    {
       public static void outputNumber(int a, int b)
        {
            int lower = a < b ? a : b;
            int upper = a > b ? a : b;
            if (upper <=1)
            {
                Console.WriteLine("无素数");
                return;
            }
            else if (lower <= 1)
                lower =2;
            Console.WriteLine("素数有：");
            int line = 0;
            for(int i = lower; i <= upper; i++)
            {
                bool isPrime = true;
                for (int j = 2; j <i; j++)
                {
                    if (i % j == 0)
                    {
                        isPrime = false;
                        break;
                    }
                }
                if (isPrime) { Console.Write(i + " "); line++; }
                if (line == 10) { Console.Write("\r\n");line = 0; }
            }
        }
    }
}
